package v1

import (
	"Im/server/common/model"
	"Im/server/util"

	"github.com/gin-gonic/gin"
)

type Stranger struct {
	ApiBaseVerify
}

// 陌生人
func (s Stranger) Friendlist(c *gin.Context) {

	fid := c.DefaultPostForm("fid", "")
	if fid == "" {
		uInfo, _ := s.GetUserInfo(c)
		fid = uInfo.Id
	}
	friendM := new(model.FriendModel)
	where := make(map[string]string)
	where["fid"] = fid
	friArr, _, bol := friendM.ListData(util.StrToUint64(fid), where)
	if bol == true {
		s.Succee(friArr, c)
	} else {
		s.Error(0, "", "无好友", c)
	}
	return
}
